//
//  SKAudioPlayer.h
//  ocDemo
//
//  Created by Joggy on 16/8/4.
//  Copyright © 2016年 Joggy. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "STKAudioPlayer.h"
#import "AppDelegate.h"

static NSString *SKAudioPlayerDidStartPlayingNotification = @"SKAudioPlayerDidStartPlayingNotification";
static NSString *SKAudioPlayerStateDidChangeNotification = @"SKAudioPlayerStateDidChangeNotification";
static NSString *SKAudioPlayerDidFinishPlayingNotification = @"SKAudioPlayerDidFinishPlayingNotification";

NS_ENUM(NSUInteger, SKAudioPlayMode) {
    SKAudioPlayModeLoopTrack = 0,       ///单曲循环
    SKAudioPlayModeLoopPlayList,        ///列表循环
    SKAudioPlayModeRandmize             ///随机播放
};

@interface AppDelegate (QYDelegate) <STKAudioPlayerDelegate>

@end


@interface STKAudioPlayer (QYSingle)

+ (STKAudioPlayer*)shareAudioPlayer;

@end


@interface SKAudioPlayer : NSObject

@property(nonatomic, readonly, assign) double duration;
@property(nonatomic, readonly, assign) double progress;
@property(nonatomic, assign) enum SKAudioPlayMode *playMode;

- (instancetype)init;

- (instancetype)initWithDelegate:(id<STKAudioPlayerDelegate>)delegate;

///指定播放URL并播放
- (void)play:(NSString*)urlString withAllURL:(NSArray*)allURL;
///指定播放路径并播放
- (void)play:(NSString*)path withAllPath:(NSArray*)allPath;
///暂停
- (void)pause;
///从暂停恢复
- (void)resume;
///停止
- (void)stop;
///跳转
- (void)seekTo:(double)value;
///注销播放器
- (void)dispose;
///返回00:00的时间格式
- (NSString*)timeFormat:(int)time;
///返回00:00:00的时间格式
- (NSString*)timeFormatWithHour:(int)time;
///传入用来指代音频播放进度的UISlider
- (void)acceptProgress:(UISlider*)slider;
///传入用来显示当前播放时间的UILabel
- (void)acceptProgressTimeLabel:(UILabel*)label;
///传入用来显示音频总时间的UILabel
- (void)acceptDurationTimeLabel:(UILabel*)label;

@end
